

package com.hazelcast.jet.impl.serialization;

import java.nio.ByteOrder;

import static com.hazelcast.internal.memory.GlobalMemoryAccessorRegistry.MEM_AVAILABLE;

public interface MemoryReader {

    static MemoryReader create(ByteOrder byteOrder) {
        return MEM_AVAILABLE ? new UnsafeMemoryReader(byteOrder) : new PlainMemoryReader(byteOrder);
    }

    int readInt(byte[] bytes, int offset);

    long readLong(byte[] bytes, int offset);
}
